//*** Guidance generated code ***//
using System;
using System.Collections.Generic;

using System.Linq;
using NHibernate;
using NHibernate.Criterion;

using ProjectBase.Core;
using ProjectBase.Data;

using $prjsn$.Common;
using $prjsn$.Common.Data.Services;
using $prjsn$.Entity.Services;

namespace $safeprojectname$.Services
{
    public class ContentTypeDao : CodeListDao<ContentType, ContentTypeFilter>, IContentTypeDao
    {
        /// <summary>Evaluates all filters and order-by clauses, paging</summary>
        public override IEnumerable<ContentType> Find(ContentTypeFilter filter)
        {
            Criteria.Append(Apply(filter));

            return GetListByCriteria(filter);
        }

        protected override IList<ICriterion> Apply(ContentTypeFilter filter)
        {
            var restrictions = base.Apply(filter);

            restrictions.AddLike(filter, f => f.Suffix);

            return restrictions;
        }
    }
}